package com.pl.lc.app.controller;

import com.pl.lc.app.service.SmsLogFeign;
import com.pl.lc.common.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version 1.0
 * @Author 小胤
 * @Date 2024/6/6 13:53
 * @注释
 */
@Api(value = "短信验证码")
@RestController
@RequestMapping("/api/sms")
public class SmsLogController {

    @Autowired
    private SmsLogFeign smsLogFeign;

    /**
     * 发送注册验证码
     * @param phone
     * @return
     */
    @ApiOperation(value = "发送注册验证码")
    @RequestMapping("/sendrcode")
    public R sendRegisterCode(@RequestParam("phone") String phone){

        return smsLogFeign.sendRegisterCode(phone);
    }

    /**
     * 发送登录验证码
     * @param phone
     * @return
     */
    @ApiOperation(value = "发送登录验证码")
    @RequestMapping("/sendlcode")
    public R sendLoginCode(@RequestParam("phone") String phone){
        return smsLogFeign.sendLoginCode(phone);
    }

}
